
		var setting1 = {	
			view: {
			showIcon: false
			},
			
			data: {
			simpleData: {
				enable: true,
				idKey: "id",
				pIdKey: "pId",
				rootPId: 0
			}
		},
			callback: {
/*				onCheck: function(event, treeId, treeNode)
				{
					console.log(1111);
					console.log(event);
					console.log(treeId);
					console.log(treeNode);
				
				},
*/				onClick: function(event, treeId, treeNode)
				{
					console.log("//////////////////////////");
					console.log("节点对象：");
					console.log(treeNode);
					console.log("//////////////////////////");

					$(".input1 span:eq(1)").text(treeNode.name);
					$(".input1 span:eq(0)").text((treeNode.id));
				
				},
			}
		};
	
	
		var setting2 = {	
			view: {
			showIcon: false
			},
		check:{
			enable: true,
			chkStyle: "checkbox",
			chkboxType: { "Y": "s", "N": "s" }
			},
			data: {
			simpleData: {
				enable: true,
				idKey: "id",
				pIdKey: "pId",
				rootPId: 0
			}
		},
			callback: {
    			onCheck: function(event, treeId, treeNode)
				{
					console.log(event);
					console.log(treeId);
					console.log(treeNode.id);
					console.log(treeNode.name);
					
					var treeObj=$.fn.zTree.getZTreeObj(treeId);
					var node=treeObj.getCheckedNodes(true);
					
					var id=[],name=[];
					$.each( node, function(i, n){
					  id.push(n.id);
					  name.push(n.name);
					});					
					
					$(".input2 span:eq(0)").text(id.join(","));
					$(".input2 span:eq(1)").text(name.join(","));
				},
				beforeClick: function(event, treeId, treeNode){return false}
			}
		};
	
	
	
		var zNodes =[
		{name:"父节点1",id:1, open:true},
		{name:"父节点11",id:11,pId:1},
		{name:"父节点12",id:12,pId:1},
		{name:"父节点13",id:13,pId:1, open:true},
		{name:"父节点11-1",id:14,pId:13},
		{name:"父节点2",id:2, open:true},
		{name:"父节点21",id:21,pId:2},
		{name:"父节点22",id:22,pId:2},
		{name:"父节点23",id:23,pId:2},
		{name:"父节点3",id:3, open:true},
		{name:"父节点31",id:31,pId:3},
		{name:"父节点32",id:32,pId:3},
		{name:"节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点节点33",id:33,pId:3},
		];




function layerztree(e)
{
	
	var dom=$(e);
	var defaults={};

		defaults.Width=dom.outerWidth()||500;
		defaults.Height=dom.outerHeight()||300;
		
		defaults.top=dom.offset().top||0;
		defaults.left=dom.offset().left||0;
		defaults.topadd=0;

console.log(defaults.Width);

	layer.open({
	  title: false,
	  closeBtn: 0,
	  shadeClose:true,
	  anim:-1,
	  fixed: false,
	  resize:false,
	  area: [defaults.Width+"px","300px"],
	  offset: [defaults.top+defaults.Height+defaults.topadd, defaults.left],
	  content: '<div class="ztree ztree1"></div>',
	  success: function(layero, index){
			$.fn.zTree.init($(".ztree1"), setting1, zNodes);

	  }
	});     
}

function layerztree2(e)
{
	
	var dom=$(e);
	var defaults={};

		defaults.Width=dom.outerWidth()||500;
		defaults.Height=dom.outerHeight()||300;
		
		defaults.top=dom.offset().top||0;
		defaults.left=dom.offset().left||0;
		defaults.topadd=0;

	layer.open({
	  title: false,
	  closeBtn: 0,
	  shadeClose:true,
	  anim:-1,
	  fixed: false,
	  resize:false,
	  area: [defaults.Width+"px","300px"],
	  offset: [defaults.top+defaults.Height+defaults.topadd, defaults.left],
	  content: '<div class="ztree ztree2" id="ztree2"></div>',
	  success: function(layero, index){

			$.fn.zTree.init($("#ztree2"), setting2, zNodes);

	  }
	});     
}